import 'package:flutter_common_utils/common_utils_export.dart';
import 'package:get/get.dart';
import 'package:flutter_base_framework/base_framework_export.dart';

class HomeVm extends BaseViewModel {
  HomeVm();

  final count = 0.obs; // 使用 .obs 使变量可观察
  List<HomeItemData> mainData = [
    HomeItemData(1, "跳转登录"),
    HomeItemData(2, "指令测试"),
  ];

  @override
  void onCreate() {
    super.onCreate();
    count.value = 10;
    LogUtils.i("HomeVm 我创建了 $count,,, ${hashCode}");
  }

  void incrementCounter() {
    count.value++;
    // VkCmdManage().dispatchConnectStatus(VkCmdServiceType.SERIAL, true, "");
    // launch((s) async {
    //   await Future.delayed(Duration(seconds: 5));
    //   VkCmdManage().dispatchConnectStatus(VkCmdServiceType.SERIAL, false, "");
    // });
  }
}

class HomeItemData {
  String title;
  int type;

  HomeItemData(
    this.type,
    this.title,
  );
}
